<style>
#tbody-goodsAttr table tr{height:35px; border-bottom:1px solid #e7e7e7;}
</style>

<table width="90%" id="properties-table"  align="center">
	<tbody>
		<tr>
			<td class="label">
				<a href="javascript:showNotice('noticeGoodsType');" title="点击此处查看提示信息">
					<img src="__PUBLIC__/image/admin/notice.gif" width="16" height="16" border="0" alt="点击此处查看提示信息">
				</a>商品类型：
			</td>
			<td>
				<select class="qs-select"  name="goods_type" onchange="getAttrList({$goods.goods_id})">
					<option value="0">请选择商品类型</option>
					{$goods_type_list}
				</select>
				<br>
				<span class="notice-span" style="display:block" id="noticeGoodsType">请选择商品的所属类型，进而完善此商品的属性</span>
			</td>
		</tr>
		<tr>
			 <td id="tbody-goodsAttr" colspan="2" style="padding:0">{$goods_attr_html}</td>
		</tr>
	</tbody>
</table>

<script>	
	/**
	 * 获取并设置属性
	 */
	function getAttrList(goodsId){
		var selGoodsType = document.forms['theForm'].elements['goods_type'];		
		if (selGoodsType != undefined){
			var goodsType = selGoodsType.options[selGoodsType.selectedIndex].value;
			$.ajax({
				type: "get",
				url: "__URL__/get_arrtibutes?" +  "goods_type=" + goodsType ,
				beforeSend: function(XMLHttpRequest){
					/*ShowLoading();*/
				},
				success: function(data, textStatus){
					//alert(data);
					$('#tbody-goodsAttr').html(data);
				},
				complete: function(XMLHttpRequest, textStatus){
					/*HideLoading();*/
				},
				error: function(){
					/*请求出错处理*/
				}			
			});
		}
	}
	function setAttrList(result, text_result){
		document.getElementById('tbody-goodsAttr').innerHTML = result.content;
	}
</script>


